package com.example.medicinetime;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBHelper extends SQLiteOpenHelper {
    public static final String TAG = "DBHelper";
    private static final int VERSION = 1;
    private static final String DB_NAME = "medicien.db";
    public static final String TB_NAME = "record";
    public static final String TB_NAME2 = "completed";


    public DBHelper(Context context, String name, SQLiteDatabase.CursorFactory factory,
                    int version) {
        super(context, name, factory, version);
    }
    public DBHelper(Context context) {
        super(context,DB_NAME,null,VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.i(TAG, "onCreate: DBHelper CREATE TABLE");
        db.execSQL("CREATE TABLE "+TB_NAME+"(ID INTEGER PRIMARY KEY AUTOINCREMENT,MNAME TEXT,STARTTIME date,DURATION INTEGER,DAYTIME time,DOSIS INTEGER,ALARMID INTEGER)");
        db.execSQL("CREATE TABLE "+TB_NAME2+"(ID INTEGER PRIMARY KEY AUTOINCREMENT,MNAME TEXT,FINISHDATE date,FINISHTIME time,FINISHDOSIS INTEGER)");

    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
